package com.inspur.myapplication.view;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.inspur.myapplication.R;

public class HomeActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);
    }

    public void btnClick(View view){
        int btnId=view.getId();
        Intent intent=new Intent(this,GoodsListActivity.class);
        switch (btnId){
            case R.id.home_shipin:
                intent.putExtra("category","shipin");//在Intent中传递数据
                break;
            case R.id.btn_fangzhi:
                intent.putExtra("category","fangzhi");//在Intent中传递数据
                break;
        }
        startActivity(intent);
    }
}
